Main effect of target
ggplot(data.complete, aes(x = age,
y = expected.1,
group = interaction(subjectID, target, domain),
color = target)) +
geom_point(size = .5, alpha = .1) +
geom_line(alpha = .1) +
geom_line(aes(y = expected_mean.1, group=target), size = 1.5, stat = 'smooth', method = 'lm', formula = y ~ poly(x,2)) +
facet_wrap(~parcellation, ncol = 2) +
geom_hline(yintercept = 0, color = 'gray') +
scale_color_manual(breaks = c('self', 'other'), values = c(self=palette[2], other=palette[1])) +
scale_x_continuous(breaks=c(10,13,16)) +
coord_cartesian(ylim=c(-1,1)) +
theme_minimal(base_size = 18)

Interaction between target and domain
ggplot(data.complete, aes(x = age,
y = expected.1,
group = interaction(subjectID, target, domain),
color = target,
linetype = domain)) +
geom_point(size = .5, alpha = .1) +
geom_line(alpha = .1) +
geom_line(aes(y = expected_mean.1, group=interaction(target,domain)), size = 1.5, stat = 'smooth', method = 'lm', formula = y ~ poly(x,2)) +
facet_wrap(~parcellation, ncol = 2) +
geom_hline(yintercept = 0, color = 'gray')+
scale_color_manual(breaks = c('self', 'other'), values = c(self=palette[2], other=palette[1]))+
scale_x_continuous(breaks=c(10,13,16)) +
coord_cartesian(ylim=c(-1,1)) +
theme_minimal(base_size = 18)
